import React, { Component } from 'react';
import { Consumer } from './context'
class dsgzj extends Component {
  constructor(props) {
    super(props);
    this.state = {  }
  }
  render() { 
    return ( 
      <div>
        <Consumer>
          {(context)=>{
            return (
              <div>
                <div>context组件 <button onClick={() => this.handClick(context)}>context修改一下</button></div>
                <div>传递内容：{context.three}</div>
              </div>
            )
          }}
        </Consumer>
      </div>
    );
  }
  handClick = (context) => {
    context.sonTurn('来自context组件的问候')
  }
}
 
export default dsgzj;